package com.example.qu_tao.presenter;

import com.example.qu_tao.contract.WodeHuopinContract;
import com.example.qu_tao.database.GoodsDao;
import com.example.qu_tao.entity.Goods;

import java.util.List;

public class WodeHuopinPresenter implements WodeHuopinContract.IWodeHuopinContract {
    private WodeHuopinContract.IWodeHuopinView mView;
    private GoodsDao goodsDao;

    public WodeHuopinPresenter(WodeHuopinContract.IWodeHuopinView view, android.content.Context context) {
        mView = view;
        goodsDao = new GoodsDao(context);
    }

    @Override
    public void getGoodsList() {
        List<Goods> goodsList = goodsDao.getAllGoods();
        mView.showGoodsList(goodsList);
    }
}